package reliability.types.logical_function;

import reliability.types.NetworkConditionMap;

public class LogicalOrOperation
    extends LogicalFunctionElement
{
    public LogicalFunctionElement operand1;
    public LogicalFunctionElement operand2;

    public LogicalOrOperation()
    {}

    public LogicalOrOperation(LogicalFunctionElement operand1, LogicalFunctionElement operand2)
    {
        this.operand1 = operand1;
        this.operand2 = operand2;
    }

    public boolean evaluate(NetworkConditionMap networkState)
    {
        return operand1.evaluate(networkState) || operand2.evaluate(networkState);
    }

    public String toString()
    {
        return operand1.toString() + "+" + operand2.toString();
    }
}
